package spring.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * project: wzq
 * ate: 14-9-4
 * author: wzq
 * description: TODO
 */
@Controller
@RequestMapping("/json/{name}")
public class JsonBodyController {

    // localhost:8080/json/haha
    @RequestMapping(method = RequestMethod.GET)
    @ResponseBody
    public UserVo toUser(@PathVariable String name) {
        System.out.println("name = " + name);
        return new UserVo(10, "aa");
    }
}
